package com.example.tms.config;

import jakarta.servlet.*;
import org.slf4j.MDC;
import java.io.IOException;

public class MDCCleanupFilter implements Filter {

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) 
        throws IOException, ServletException {
        try {
            chain.doFilter(request, response);
        } finally {
            // 清理MDC
            MDC.clear();
        }
    }
}
